<template>
    <el-table :data="modeldata"  stripe border style="width: 100%">
        <el-table-column prop="c_name" label="科目" width="180" />
        <el-table-column prop="grade" label="成绩" width="180" />
        <el-table-column prop="t_name" label="老师" width="180" />
    </el-table>
</template>

<script setup>
import { reactive, defineProps, onMounted, ref } from "vue";
import { ElTable } from "element-plus";
import { getStudentGradeById } from '../API/ApiMethod'
components: {
    ElTable
}
const proxy = defineProps({
    studentCourseId: {
        require: true
    }
})
let modeldata = reactive([])
onMounted(() => {
    console.log('id',proxy.studentCourseId)
    getStudentGradeById(proxy.studentCourseId).then(res => {
        if (res.code == 10000) {
           res.data.forEach(item=>{
            modeldata.push(item)
           })
           console.log(modeldata)
        } else {
            ElMessage({
                message: '查询',
                type: 'error'
            })
        }
    })
})

</script>


<style>

</style>